<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-3.4.1.min.js"></script>
    <script>
        $(function(){
            var stu=window.location.search;
            stu=stu.substring(1);
            alert(stu);
            $.get("findStu.do",{stuno:stu},function(student){
                //$("#sname").val(student.ssname);
                //$("[name=sname]").val(student.sname);
                for(var val in student){
                    console.log(val+", ");
                    $("[name="+val+"]").val(student[val]);
                }
                //特殊处理
                $("input[name=gender][value='"+student.sex+"']").prop("checked",true);
                $("#card").attr("src","img/"+student.idcardpic);
            });
        });
    </script>
</head>
<body>
<form action="doUpdateStudent.jsp" method="post">
    <input type="hidden" name="stuno" value="" />
    <p>
        姓名:<input type="text" name="sname" value=""/>
    </p>
    <p>
        性别：<input type="radio" name="gender" value="男"/>男
        <input type="radio" name="gender" value="女"/>女
        <input type="radio" name="gender" value="妖"/>妖
    </p>
    <p>

        年级：
        <select name="gradeid" id="gradeid">

        </select>
    </p>
    <p>
        入学时间:<input type="text" name="enterdate" value=""/>
    </p>
    <p>
        照片:<input type="file" name="idcardpic" value=""/>
        <img src="" id="card" height="200px" width="200px"/>
    </p>
    <p>
        <input type="submit" value="保存"/>
    </p>
</form>
</body>
</html>